package com.itlong.cloud.property.resource;

import com.itlong.cloud.POJO.DTO.property.PropertyArrearPeopleSelectDTO;
import com.itlong.cloud.POJO.VO.property.PropertyArrearPeopleSelectVO;
import com.itlong.cloud.paymenthub.IPropertyArrearPeopleSelectServiceClient;
import com.itlong.cloud.property.service.IPropertyArrearPeopleSelectService;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <desc>
 *      欠费住户查询接口暴露实现类
 * </desc>
 *
 * @createDate 2019/05/21
 */
@RestController
public class PropertyArrearPeopleSelectServiceResource implements IPropertyArrearPeopleSelectServiceClient {

    @Autowired
    private IPropertyArrearPeopleSelectService iPropertyArrearPeopleSelectService;

    /**
     * <desc>
     *      分页获取欠费住户信息
     * </desc>
     *
     * @param propertyArrearPeopleSelectDTO 欠费住户信息DTO
     * @return 欠费住户分页信息
     * @author wangzhi
     * @createDate 2019/05/21
     */
    @Override
    @PostMapping("/property/arrearagePeopleSelect/getPage")
    public Page<PropertyArrearPeopleSelectVO> getPage(@RequestBody PropertyArrearPeopleSelectDTO propertyArrearPeopleSelectDTO) throws Exception {
        return iPropertyArrearPeopleSelectService.getPage(propertyArrearPeopleSelectDTO);
    }

    /**
     * <desc>
     *      临时解除限制
     * </desc>
     *
     * @param propertyArrearPeopleSelectDTO 欠费住户信息DTO
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/05/22
     */
    @Override
    @PostMapping("/property/arrearagePeopleSelect/momentRelieve")
    public Integer momentRelieve(@RequestBody PropertyArrearPeopleSelectDTO propertyArrearPeopleSelectDTO) throws Exception {
        return iPropertyArrearPeopleSelectService.momentRelieve(propertyArrearPeopleSelectDTO);
    }

    /**
     * <desc>
     *      获取导出的欠费住户信息
     * </desc>
     *
     * @param propertyArrearPeopleSelectDTO 欠费住户信息DTO
     * @return 欠费住户列表信息
     * @author wangzhi
     * @createDate 2019/05/22
     */
    @Override
    @PostMapping("/property/arrearagePeopleSelect/getExportData")
    public List<PropertyArrearPeopleSelectVO> getExportData(@RequestBody PropertyArrearPeopleSelectDTO propertyArrearPeopleSelectDTO) throws Exception {
        return iPropertyArrearPeopleSelectService.getExportData(propertyArrearPeopleSelectDTO);
    }
}
